:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --accent-color: #FF2D55;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --background-color: #F2F2F7;
    --card-background: #ffffff;
    --text-color: #1C1C1E;
    --text-secondary: #8E8E93;
    --border-color: #E5E5EA;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.vibrant-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--card-background);
    padding: 3rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.vibrant-header h1 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
}

.tagline {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.deadline {
    font-size: 1rem;
    margin-top: 1rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.generator-section {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

.api-category-section,
.data-collection-section,
.tracking-section,
.att-section {
    margin: 2rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

h4 {
    color: var(--text-secondary);
    margin: 1rem 0;
    font-weight: 500;
    font-size: 1rem;
}

.api-options,
.data-options,
.purpose-options {
    display: grid;
    gap: 0.8rem;
}

.api-option,
.data-option,
.purpose-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: var(--background-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.api-option:hover,
.data-option:hover,
.purpose-option:hover {
    background: rgba(0, 122, 255, 0.1);
}

.api-option input[type="checkbox"],
.data-option input[type="checkbox"],
.purpose-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.tooltip {
    display: none;
    position: absolute;
    background: var(--text-color);
    color: var(--card-background);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    top: 0;
    left: 100%;
    margin-left: 1rem;
    width: 300px;
    z-index: 100;
    box-shadow: var(--shadow);
}

.tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 1rem;
    border: 8px solid transparent;
    border-right-color: var(--text-color);
}

.tooltip strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.5rem;
}

.tooltip code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.tooltip .reason-item {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.tooltip .reason-item small {
    display: block;
    margin-top: 0.3rem;
    opacity: 0.7;
    font-size: 0.8rem;
    color: var(--warning-color);
}

.api-option {
    position: relative;
}

.api-option:hover .tooltip {
    display: block;
}

.tracking-option {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    position: relative;
}

.tracking-purposes,
.tracking-domains {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
}

.domain-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.domain-input-group input {
    flex: 1;
}

.add-domain-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.add-domain-btn:hover {
    opacity: 0.9;
}

.domain-list {
    list-style: none;
}

.domain-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--card-background);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.remove-domain {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.generate-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.generate-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.output-section {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 2rem;
}

.manifest-output {
    background: #1C1C1E;
    color: #FFFFFF;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.manifest-output pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.copy-btn,
.download-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.copy-btn:hover,
.download-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.vibrant-footer {
    text-align: center;
    padding: 2rem;
    background: var(--text-color);
    color: var(--card-background);
    margin-top: 3rem;
}

.footer-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .output-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .vibrant-header h1 {
        font-size: 2rem;
    }
    
    .container {
        margin: 1rem auto;
    }
    
    .generator-section,
    .output-section {
        padding: 1rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .tooltip {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .tooltip {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        width: 90%;
        max-width: 400px;
    }
    
    .tooltip::before {
        display: none;
    }
}

.api-reasons {
    margin-left: 2rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    margin-top: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

.reason-options {
    display: grid;
    gap: 0.8rem;
}

.reason-option {
    margin: 10px 0;
    padding: 12px;
    background: var(--card-background);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.reason-option:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reason-option label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.reason-option code {
    display: inline-block;
    padding: 2px 6px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.9em;
}

.reason-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reason-text .zh {
    font-weight: 500;
    color: var(--text-color);
}

.reason-text .en {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.reason-note {
    font-size: 0.85em;
    color: var(--text-secondary);
    padding: 8px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.api-reasons {
    margin-left: 20px;
    padding: 10px;
    background: var(--background-color);
    border-radius: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.api-reasons.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .api-reasons {
        margin-left: 1rem;
    }
    
    .reason-option {
        padding: 0.6rem;
    }
}

.data-targets,
.data-reasons {
    margin-left: 20px;
    padding: 10px;
    background: var(--background-color);
    border-radius: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.data-targets.show,
.data-reasons.show {
    opacity: 1;
    transform: translateY(0);
}

.target-options,
.data-reason-options {
    display: grid;
    gap: 8px;
}

.target-option,
.data-reason-option {
    background: var(--card-background);
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.target-option:hover,
.data-reason-option:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.target-option label,
.data-reason-option label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.target-option .zh,
.data-reason-option .zh {
    font-weight: 500;
    color: var(--text-color);
}

.target-option .en,
.data-reason-option .en {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.data-category {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.data-category h4 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 600;
}

.data-options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

@media (max-width: 768px) {
    .data-targets,
    .data-reasons {
        margin-left: 10px;
    }
    
    .data-options {
        grid-template-columns: 1fr;
    }
    
    .target-option,
    .data-reason-option {
        padding: 8px;
    }
}

.data-options-container {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.data-targets-section,
.data-purposes-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.data-targets-section h4,
.data-purposes-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-weight: 600;
}

.target-options,
.purpose-options {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.target-option,
.purpose-option {
    background: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.target-option:hover,
.purpose-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.target-option input[type="checkbox"],
.purpose-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.data-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.data-type-dropdown {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--card-background);
    color: var(--text-color);
}

.data-type-dropdown optgroup {
    font-weight: 600;
    color: var(--text-secondary);
}

.add-data-type-btn {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-data-type-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

.selected-data-types {
    display: grid;
    gap: 1rem;
}

.data-type-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.data-type-card.show {
    opacity: 1;
    transform: translateY(0);
}

.data-type-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.data-type-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-type-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.data-type-group {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.data-type-content {
    display: grid;
    gap: 1.5rem;
}

.data-type-targets,
.data-type-purposes {
    background: var(--background-color);
    padding: 1.2rem;
    border-radius: 8px;
}

.target-options,
.purpose-options {
    display: grid;
    gap: 0.8rem;
}

.target-option,
.purpose-option {
    background: var(--card-background);
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.target-option:hover,
.purpose-option:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.target-option input[type="checkbox"],
.purpose-option input[type="checkbox"] {
    margin-top: 4px;
}

.target-text,
.purpose-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.target-text .zh,
.purpose-text .zh {
    font-weight: 500;
    color: var(--text-color);
}

.target-text .en,
.purpose-text .en {
    font-size: 0.9em;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .data-type-card {
        padding: 1rem;
    }
    
    .target-options,
    .purpose-options {
        grid-template-columns: 1fr;
    }
}

/* 已添加项的样式 */
.selected-items-summary {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--background-color);
    border-radius: 8px;
}

.selected-items-summary h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
}

.selected-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.selected-items-list li {
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--card-background);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.selected-items-list li strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
}

.selected-items-list li div {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0;
}

/* 已选择的数据类型样式 */
.selected-items-grid {
    display: grid;
    gap: 1rem;
}

.selected-item {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.selected-item.show {
    opacity: 1;
    transform: translateY(0);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-group {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.item-name {
    font-weight: 500;
    color: var(--text-color);
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.remove-item-btn:hover {
    background: rgba(255, 45, 85, 0.1);
}

.item-summary {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.8rem;
}

.item-targets-summary,
.item-purposes-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.selected-targets,
.selected-purposes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.target-tag,
.purpose-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--background-color);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.no-selection {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .item-summary {
        gap: 0.6rem;
    }
    
    .target-tag,
    .purpose-tag {
        padding: 3px 6px;
        font-size: 0.85rem;
    }
}